package com.itlong.cloud.project.property;

import com.itlong.cloud.POJO.DTO.property.PropertyProjectGetBuildInfoDTO;
import com.itlong.cloud.POJO.DTO.property.PropertyProjectGetBuildSimpleInfoDTO;
import com.itlong.cloud.POJO.DTO.property.PropertyProjectSaveBuildInfoDTO;
import com.itlong.cloud.POJO.DTO.property.PropertyProjectUpdateBuildInfoDTO;
import com.itlong.cloud.POJO.VO.property.PropertyProjectBuildInfoVO;
import com.itlong.cloud.POJO.VO.property.PropertyProjectBuildSimpleInfoExVO;
import com.itlong.cloud.POJO.VO.property.PropertyProjectBuildSimpleInfoVO;
import com.itlong.cloud.utils.page.Page;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
* <desc>
*       楼栋信息服务接口协议提供对象.
* </desc>
*
* @createDate 2017-09-22
*/
@FeignClient(name = "project-service")
public interface IPropertyBuildInfoServiceClient {



    /**
     * <desc>
     *      保存楼栋信息
     * </desc>
     *
     * @param propertyProjectSaveBuildInfoDTO 添加楼栋信息数据传输对象
     * @return  受影响的行数
     * @author LouisLewis
     * @createDate 2017-09-18
     */
    @RequestMapping(path = "property/buildInfo/saveBuildInfo",method = {RequestMethod.POST})
    Integer saveBuildInfo(@RequestBody PropertyProjectSaveBuildInfoDTO propertyProjectSaveBuildInfoDTO) throws Exception;

    /**
     * <desc>
     *      修改楼栋信息【根据楼栋Id（BuildId）】
     * </desc>
     *
     * @param propertyProjectUpdateBuildInfoDTO 修改楼栋信息数据传输对象
     * @return  受影响的行数
     * @author LouisLewis
     * @createDate 2017-09-26
     */
    @RequestMapping(path = "property/buildInfo/updateBuildInfo",method = {RequestMethod.POST})
    Integer updateBuildInfo(@RequestBody PropertyProjectUpdateBuildInfoDTO propertyProjectUpdateBuildInfoDTO) throws Exception;


    /**
     * <desc>
     *     逻辑删除楼栋信息【根据楼栋Id（BuildId）】
     * </desc>
     *
     * @param buildId 待删除的楼栋Id
     * @return 受影响的行数
     * @author LouisLewis
     * @createDate 2017-09-26
     */
    @RequestMapping(path = "property/buildInfo/removeBuildInfo/{buildId}",method = {RequestMethod.GET})
    Integer removeBuildInfo(@PathVariable("buildId")String buildId);

    /**
     * <desc>
     *      分页查询楼栋信息
     * </desc>
     *
     * @param propertyProjectGetBuildInfoDTO 分页查询楼栋信息数据传输对象
     * @return 分页查询结果对象
     * @author LouisLewis
     * @createDate 2017-09-25
     */
    @RequestMapping(path = "property/buildInfo/getPage",method = {RequestMethod.POST})
    Page<PropertyProjectBuildInfoVO> getPage(@RequestBody PropertyProjectGetBuildInfoDTO propertyProjectGetBuildInfoDTO) throws Exception;


    /**
     * <desc>
     *      获取指定项目下的楼栋简单信息（楼栋id ,楼栋名称）列表
     * </desc>
     *
     * @param propertyProjectGetBuildSimpleInfoDTO 查询楼栋简单信息（楼栋ID，楼栋名称）数据传输对象
     * @return 楼栋简单信息（楼栋id ,楼栋名称）列表
     * @author LewisLouis
     * @createDate 2017-09-28
     */
    @RequestMapping(path = "property/buildInfo/getPageBuildSimpleInfo",method = {RequestMethod.POST})
    Page<PropertyProjectBuildSimpleInfoVO> getPageBuildSimpleInfoList(
            @RequestBody PropertyProjectGetBuildSimpleInfoDTO propertyProjectGetBuildSimpleInfoDTO) throws Exception;


    /**
     * <desc>
     *      分页查询指定项目下的楼栋简单扩展信息（楼栋id ,楼栋名称，楼栋下的房间数量）列表
     * </desc>
     *
     * @param propertyProjectGetBuildSimpleInfoDTO 查询楼栋简单扩展信息（楼栋id ,楼栋名称，楼栋下的房间数量）数据传输对象
     * @return 楼栋简单扩展信息（楼栋id ,楼栋名称，楼栋下的房屋数量）列表
     * @author LewisLouis
     * @createDate 2017-11-10
     */
    @RequestMapping(path = "property/buildInfo/getPageBuildSimpleInfoEx",method = {RequestMethod.POST})
    Page<PropertyProjectBuildSimpleInfoExVO> getPageBuildSimpleInfoExList(
            @RequestBody PropertyProjectGetBuildSimpleInfoDTO propertyProjectGetBuildSimpleInfoDTO) throws  Exception;
    /**
     * <desc>
     *      精确查询，获取单个楼栋信息
     * </desc>
     * @param propertyProjectGetBuildInfoDTO 查询楼栋信息数据传输对象
     * @return 按创建时间降序排列，首个符合查询条件的楼栋信息
     * @author LouisLewis
     * @createDate 2017-09-25
     */
    @RequestMapping(path = "property/buildInfo/getOneBuildInfo",method = {RequestMethod.POST})
    PropertyProjectBuildInfoVO getOneBuildInfo(@RequestBody PropertyProjectGetBuildInfoDTO propertyProjectGetBuildInfoDTO);

    /**
     * <desc>
     *     获取指定项目的最小可用楼栋编号buildNum
     * </desc>
     *
     * @param projectId 项目id
     * @return 最小可用的楼栋编号
     * @author wangzhi
     * @createDate 2018/05/29
     */
    @RequestMapping(path = "property/buildInfo/getMinAvaliableBuildNumByProjectId",method = {RequestMethod.POST})
    String getMinAvaliableBuildNumByProjectId(@RequestParam("projectId") String projectId);
}
